<template>
	<div style="border-radius: 5px; padding: 10px;">
		<el-table :data="tableData" border style="margin-top: 10px;" v-loading="dataListLoading">
			<el-table-column fixed prop="outTradeNo" label="订单编号" align="center">
			</el-table-column>
			<el-table-column fixed prop="outRequestNo" label="退款编号" align="center">
			</el-table-column>
			<el-table-column prop="refundAmount" label="退款金额" align="center" header-align="center">
			</el-table-column>
			<el-table-column prop="refundReason" label="退款原因" align="center" header-align="center">
			</el-table-column>
			<el-table-column prop="operatorId" label="操作员" align="center" header-align="center">
			</el-table-column>
			<el-table-column prop="createTime" label="退款时间" align="center" header-align="center">
				<template slot-scope="scope">
					{{scope.row.createTime | formatDate}}
				</template>
			</el-table-column>
		</el-table>
		<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageIndex"
		 :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
		</el-pagination>
	</div>
</template>

<script>
	import {getAlipayRefundRecordList} from "@/api/alipay/alipay.js"
	import {formatDate} from "@/utils/common.js"
	export default {
		data(){
			return{
				tableData:[],
				dataListLoading:false,
				pageTotal:0,
				pageSize:10,
				pageIndex:1,
			}
		},
		created: function() {
		},
		filters: {
			formatDate(time) {
				var date = new Date(time);
				return formatDate(date, 'yyyy-MM-dd hh:mm');
			}
		},
		components: {
		},
		mounted:function(){
			this.getDataList(this.pageIndex,this.pageSize)
		},
		methods:{
			handleSizeChange(val){
				this.pageIndex=1
				this.pageSize = val
				this.getDataList(this.pageIndex,this.pageSize)
			},
			handleCurrentChange(val){
				this.pageIndex = val
				this.getDataList(this.pageIndex,this.pageSize)
			},
			getDataList(index,size){
				getAlipayRefundRecordList(index,size).then(data=>{
					if(data.code=="0000"){
						this.tableData = data.data
					}else{
						this.$message.error(data.msg)
					}
				})
			},
		}
	}
</script>

<style>
</style>

